Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cmake projects integration #1

Merged
merged 1 commit into from
Apr 28, 2024
Merged

Conversation

cnt0
Copy link
Contributor

@cnt0 cnt0 commented Apr 28, 2024

This allows us to add wayland protocol dependencies to other cmake-based projects with minimum extra code.

The idea is to move protocolNew() definition from hyprland CMakeLists.txt to this project and have something like that there:

add_executable(Hyprland)

find_package(hyprwayland-scanner REQUIRED)
hyprwayland_protocol(
    Hyprland
    "linux-dmabuf-v1"
    "${WAYLAND_PROTOCOLS}/linux-dmabuf/"
    "${CMAKE_SOURCE_DIR}/protocols"
)

BTW the 1st argument of hyprwayland_protocol() can actually be a list of targets, not just one

This allows us to add wayland protocol dependencies to other cmake-based
projects with minimum extra code.

Example:

find_package(hyprwayland-scanner REQUIRED)
add_executable(target main.c)
hyprwayland_protocol(
    target
    "linux-dmabuf-v1"
    "${WAYLAND_PROTOCOLS}/linux-dmabuf/"
    "${CMAKE_SOURCE_DIR}/protocols"
)
@vaxerski
Copy link
Member

tanks :)

@vaxerski vaxerski merged commit abbade0 into hyprwm:main Apr 28, 2024
1 check passed
@cnt0 cnt0 deleted the hyprwayland-config branch April 28, 2024 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants